﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Standard;
using Web.Attributes;

namespace TestHttpModules.Controllers
{
    public class AccountController : Controller
    {
        //
        // GET: /Account/

        /// <summary>
        /// 登陆
        /// </summary>
        /// <returns></returns>
        public ActionResult LogOn()
        {
            return View();
        }

        [UserAuthentication(AuthenticationType.Login)]
        [HttpPost]
        public ActionResult LogOn(User entity)
        {
            if (entity != null)
            {
                ClientHelper.WriteUserInfo(new User
                {
                    ID = 1,
                    Name = entity.Name,
                });
                Response.Redirect(Request.QueryString["returnURl"]);
            }
            return View();
        }
 
    }
}
